﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Data.Objects;
using WFBot.Framework.Domain;

namespace WFBot.Data.Configuration
{
    public class OperatorConfiguration : EntityConfiguration<Operator>
    {
        public OperatorConfiguration()
        {
            HasKey(o => o.Id);

            Property(o => o.Id).IsIdentity();
            Property(o => o.SipUri).IsRequired();
            Property(o => o.DisplayName).IsUnicode().IsRequired();
            Property(o => o.CurrentChannel);
            Property(o => o.Group);
            Property(o => o.Busy);

            MapSingleType(o => new
            {
                o.Id,
                o.SipUri,
                o.DisplayName,
                o.CurrentChannel,
                o.Group,
                o.Busy
            });
        }
    }
}
